package com.beta.mq.redis;

import com.beta.mq.redis.aop.ShareStatisticsAspect;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass(name = {"org.redisson.api.RedissonClient", "org.aspectj.lang.annotation.Aspect"})
@ComponentScan(basePackageClasses = StatistiesConfiguration.class)
public class StatistiesConfiguration {

    @Bean
    @ConditionalOnProperty(name = "com.beta.fpcs.svc.manager.shareStatistics.enable", havingValue = "true", matchIfMissing = false)
    public ShareStatisticsAspect shareStatisticsAspect(){
        return new ShareStatisticsAspect();
    }
}
